<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!-- 启用360浏览器的极速模式(webkit) -->
	<meta name="renderer" content="webkit" />
	<!-- 避免IE使用兼容模式 -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<meta name="format-detection" content="telephone=no" />
	<title></title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<script type="text/javascript" src="js/rem.js"></script>
	<script type="text/javascript" src="js/common.js"></script>
	<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
	<link rel="stylesheet" href="css/liMarquee.css">
	<link rel="stylesheet" href="css/swiper.min.css">
	<link rel="stylesheet" href="css/animate.min.css">
	<link rel="stylesheet" href="css/style.css?v=1.0" />
	<script type="text/javascript">
		function checkLoginPermission() {
			// fat
			// var pcLoginUrl = 'http://xiechang2-fat.sfrog.cn/index.html'
			// uat
			var pcLoginUrl = 'http://xiechang2.xiechang.com/index.html'
			var pcAdminToken = localStorage.getItem('pcAdminToken');
			// 无token直接返回无权限
			if (!pcAdminToken) {
				window.location.href = pcLoginUrl;
				return
			}

			$.ajax({
				url: baseUrl + '/pcApi/biz/pcIndex/checkLoginPermission',
				type: 'post',
				contentType: 'application/json',
				data: JSON.stringify({ pcAdminToken: pcAdminToken }),
				async: false,
				success: function (res) {
					if ('noPermission' === res.data.permissionFlag) {
						window.location.href = pcLoginUrl;
					}
				},
				error: function (err) {
					window.location.href = pcLoginUrl;
				}
			});
		}

		checkLoginPermission();
	</script>
</head>

<body>
	<header>
		<div class="logo">
			<img src="images/home_icon/default_logo@2x.png" alt="">
			<p>苏州协昌环保科技股份有限公司</p>
		</div>
		<h1>烟尘治理云平台</h1>
		<div class="time">
			<div id="time"></div>
			<div>
				<p id="week"></p>
				<p id="show"></p>
			</div>
			<div onclick="fullScreen()"><img src="images/icon_full screen@2x.png" alt=""></div>
			<div onclick="exitScreen()"><img src="images/icon_close_highlighted@2x.png" alt=""></div>
		</div>
	</header>
	<div class="mainbox">
		<div class="box">
			<div class="box_list">
				<div class="title">
					<img src="images/home_icon/icon_sence_default@2x.png" alt="">
					<p>现场展示</p>
				</div>
				<div class="banner">
					<div class="swiper-container swiper-container1">
						<div class="swiper-wrapper">
							<!--<div class="swiper-slide">
								<img src="images/banner.jpg" alt="">
							</div>
							<div class="swiper-slide">
								<img src="images/banner.jpg" alt="">
							</div>-->
						</div>
						<div class="swiper-pagination"></div>
					</div>
				</div>
			</div>
			<div class="box_list box_list1">
				<!-- <div class="box_nav">
					<div class="title">
						<img src="images/home_icon/icon_pro_default@2x.png" alt="">
						<p>生产情况占比</p>
					</div>
					<div class="box-border">
						<div id="produce">
						</div>
					</div>
				</div> -->
				<div class="box_nav">
					<div class="title">
						<img src="images/home_icon/icon_patent_default@2x.png" alt="">
						<p>专利技术利用率</p>
					</div>
					<div class="box-border">
						<div id="patent">
						</div>
					</div>
				</div>
			</div>
			<div class="box_list">
				<div class="title">
					<img src="images/home_icon/icon_industry_default@2x.png" alt="">
					<p>行业分布占比</p>
				</div>
				<div class="banner">
					<div id="trade">
					</div>
				</div>
			</div>
		</div>
		<div class="box-center">
			<ul class="number">
				<li>
					<img src="images/home_icon/icon_duster_default@2x.png" alt="">
					<div>
						<p>除尘器总量</p>
						<span class="counter catcher-count">0</span>
					</div>
				</li>
				<li>
					<img src="images/home_icon/icon_room_default@2x.png" alt="">
					<div>
						<p>箱室总量</p>
						<span class="counter box-count">0</span>
					</div>
				</li>
				<li>
					<img src="images/home_icon/icon_air_default@2x.png" alt="">
					<div>
						<p>气包总量</p>
						<span class="counter pocket-count">0</span>
					</div>
				</li>
				<li>
					<img src="images/home_icon/icon_valve_default@2x.png" alt="">
					<div>
						<p>智能阀总量</p>
						<span class="counter zhi-valve-count">0</span>
					</div>
				</li>
			</ul>
			<div class="ditu_box">
				<div class="title">
					<img src="images/home_icon/icon_map_default@2x.png" alt="">
					<p>全国设备分布情况</p>
				</div>
				<div class="ditu">
					<div id="map"></div>
				</div>
			</div>
			<div class="circle_info">
				<div class="title">
					<img src="images/home_icon/icon_on_default@2x.png" alt="">
					<p>行业在线运行率</p>
				</div>
				<div class="circle">
					<ul>
						<li class="my_circle-class-1">
							<canvas id="my_circle0" width="100%" height="80%"></canvas>
							<div class="fenxi fenxi0"></div>
						</li>
						<li class="my_circle-class-2">
							<canvas id="my_circle1" width="100%" height="80%"></canvas>
							<div class="fenxi fenxi1"></div>
						</li>
						<li class="my_circle-class-3">
							<canvas id="my_circle2" width="100%" height="80%"></canvas>
							<div class="fenxi fenxi2"></div>
						</li>
						<li class="my_circle-class-4">
							<canvas id="my_circle3" width="100%" height="80%"></canvas>
							<div class="fenxi fenxi3"></div>
						</li>
						<li class="my_circle-class-5">
							<canvas id="my_circle4" width="100%" height="80%"></canvas>
							<div class="fenxi fenxi4"></div>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<div class="box">
			<div class="box_list">
				<div class="title">
					<img src="images/home_icon/icon_business01_default@2x.png" alt="">
					<p>企业应用列表</p>
				</div>
				<div class="box-right">
					<div class="scroll">
						<ul class="scroll_nav">
							<li>序号</li>
							<li>企业名称</li>
							<li>脉冲阀</li>
							<li>控制仪</li>
							<li>采集器</li>
						</ul>
						<div class="scroll-company-wrap">
							<ul class="scroll_list company-list">
								<!--<li class="scroll_info">
								<ul class="scroll_nav">
									<li>1</li>
									<li>广西柳州钢铁集团公司</li>
									<li>2110</li>
									<li>110</li>
									<li>10</li>
								</ul>
							</li>
							<li class="scroll_info">
								<ul class="scroll_nav">
									<li>2</li>
									<li>华新水泥阳新有限公司</li>
									<li>1210</li>
									<li>80</li>
									<li>4</li>
								</ul>
							</li>
							<li class="scroll_info">
								<ul class="scroll_nav">
									<li>3</li>
									<li>华新水泥大冶有限公司</li>
									<li>810</li>
									<li>90</li>
									<li>14</li>
								</ul>
							</li>
							<li class="scroll_info">
								<ul class="scroll_nav">
									<li>4</li>
									<li>石川制铁</li>
									<li>1960</li>
									<li>160</li>
									<li>8</li>
								</ul>
							</li>-->
							</ul>
						</div>
					</div>
				</div>
			</div>
			<div class="box_list">
				<div class="title">
					<img src="images/home_icon/icon_monitor_default@2x.png" alt="">
					<p>设备监测</p>
				</div>
				<div class="box-right baifenbi">
					<div id="device">
					</div>
					<div class="danwei">单位:百分比</div>
				</div>
			</div>
			<div class="box_list">
				<div class="title">
					<img src="images/home_icon/icon_overhaul_default@2x.png" alt="">
					<p>检修提醒</p>
				</div>
				<div class="box-right scroll_up">
					<ul class="service examine-reminder-page">
						<!--<li class="service_list">
							<div class="service_name">
								<img src="images/home_icon/icon_surplus_default@2x.png" alt="">
								<p>距离保修年限</p>
								<span>3年</span>
							</div>
							<div class="flicker">
								<div class="flicker1"></div>
								<div class="flicker2"></div>
								<div class="flicker3"></div>
							</div>
							<ul class="service_info">
								<li>
									<img src="images/home_icon/icon_business_default@2x.png" alt="">
									<p>企业名称：广西柳州钢铁集团公司</p>
								</li>
								<li>
									<img src="images/home_icon/icon_time_default@2x.png" alt="">
									<p>购买日期：2020年6月30日</p>
								</li>
								<li>
									<img src="images/home_icon/icon_gua_default@2x.png" alt="">
									<p>保修年限：5年</p>
								</li>
							</ul>
						</li>
						<li class="service_list">
							<div class="service_name">
								<img src="images/home_icon/icon_surplus_default@2x.png" alt="">
								<p>距离保修年限</p>
								<span>1个月</span>
							</div>
							<div class="flicker">
								<div class="flicker1 dilcker1"></div>
								<div class="flicker2 dilcker2"></div>
								<div class="flicker3 dilcker3"></div>
							</div>
							<ul class="service_info">
								<li>
									<img src="images/home_icon/icon_business_default@2x.png" alt="">
									<p>企业名称：华新水泥阳新有限公司</p>
								</li>
								<li>
									<img src="images/home_icon/icon_time_default@2x.png" alt="">
									<p>购买日期：2019年4月15日</p>
								</li>
								<li>
									<img src="images/home_icon/icon_gua_default@2x.png" alt="">
									<p>保修年限：4年</p>
								</li>
							</ul>
						</li>
						<li class="service_list">
							<div class="service_name">
								<img src="images/home_icon/icon_surplus_default@2x.png" alt="">
								<p>距离保修年限</p>
								<span>3年</span>
							</div>
							<div class="flicker">
								<div class="flicker1"></div>
								<div class="flicker2"></div>
								<div class="flicker3"></div>
							</div>
							<ul class="service_info">
								<li>
									<img src="images/home_icon/icon_business_default@2x.png" alt="">
									<p>企业名称：广西柳州钢铁集团公司</p>
								</li>
								<li>
									<img src="images/home_icon/icon_time_default@2x.png" alt="">
									<p>购买日期：2020年6月30日</p>
								</li>
								<li>
									<img src="images/home_icon/icon_gua_default@2x.png" alt="">
									<p>保修年限：5年</p>
								</li>
							</ul>
						</li>
						<li class="service_list">
							<div class="service_name">
								<img src="images/home_icon/icon_surplus_default@2x.png" alt="">
								<p>距离保修年限</p>
								<span>1个月</span>
							</div>
							<div class="flicker">
								<div class="flicker1 dilcker1"></div>
								<div class="flicker2 dilcker2"></div>
								<div class="flicker3 dilcker3"></div>
							</div>
							<ul class="service_info">
								<li>
									<img src="images/home_icon/icon_business_default@2x.png" alt="">
									<p>企业名称：华新水泥阳新有限公司</p>
								</li>
								<li>
									<img src="images/home_icon/icon_time_default@2x.png" alt="">
									<p>购买日期：2019年4月15日</p>
								</li>
								<li>
									<img src="images/home_icon/icon_gua_default@2x.png" alt="">
									<p>保修年限：4年</p>
								</li>
							</ul>
						</li>-->
					</ul>
				</div>
			</div>
			<div class="box_list">
				<div class="title">
					<img src="images/home_icon/icon_record_default@2x.png" alt="">
					<p>运维记录</p>
				</div>
				<div class="box-right box-right1">
					<div id="scroll1" class="scroll scroll1">
						<ul class="scroll_nav">
							<li>状态</li>
							<li>企业简称</li>
							<li>监测工段</li>
							<li>类型</li>
							<li>时间</li>
						</ul>
						<ul class="scroll_list maintenance-page">
							<!--<li class="scroll_info">
								<ul class="scroll_nav">
									<li>已处理</li>
									<li>广西柳州钢铁集团有限公司</li>
									<li>1号水泥</li>
									<li>智能阀</li>
									<li>2021-5-3</li>
								</ul>
							</li>
							<li class="scroll_info scroll_info1">
								<ul class="scroll_nav">
									<li>未处理</li>
									<li>广西柳州钢铁集团有限公司</li>
									<li>1号水泥</li>
									<li>智能阀</li>
									<li>2021-5-3</li>
								</ul>
							</li>
							<li class="scroll_info">
								<ul class="scroll_nav">
									<li>已处理</li>
									<li>广西柳州钢铁集团有限公司</li>
									<li>1号水泥</li>
									<li>智能阀</li>
									<li>2021-5-3</li>
								</ul>
							</li>
							<li class="scroll_info scroll_info1">
								<ul class="scroll_nav">
									<li>未处理</li>
									<li>广西柳州钢铁集团有限公司</li>
									<li>1号水泥</li>
									<li>智能阀</li>
									<li>2021-5-3</li>
								</ul>
							</li>-->
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="js/swiper.min.js"></script>
	<script type="text/javascript" src="js/swiper.animate.min.js"></script>
	<!-- 数字跳动 -->
	<script type="text/javascript" src="js/jquery.waypoints.min.js"></script>
	<script type="text/javascript" src="js/jquery.countup.js"></script>
	<!-- 数据自动向上滑动 -->
	<!-- <script type="text/javascript" src="js/jquery.SuperSlide.2.1.3.js"></script> -->
	<script type="text/javascript" src="js/jquery.liMarquee.js"></script>
	<script type="text/javascript" src="js/echarts.min.js"></script>
	<script type="text/javascript" src="js/echarts-gl.min.js"></script>
	<!-- <script type="text/javascript" src="js/china.js"></script> -->
	<script type="text/javascript" src="js/ditu2.js"></script>
	<script type="text/javascript" src="js/index.js"></script>
	<script type="text/javascript" src="js/progress.js"></script>
	<!-- 顶部时间 -->
	<script type="text/javascript">
		window.onload = function () {
			showTime();
		}

		function checkTime(i) {
			if (i < 10) {
				i = "0" + i;
			}
			return i;
		}

		function showTime() {
			var now = new Date();
			var year = now.getFullYear();
			var month = now.getMonth() + 1;
			var day = now.getDate();
			var h = now.getHours();
			var m = now.getMinutes();
			var s = now.getSeconds();
			m = checkTime(m)
			s = checkTime(s)

			var weekday = new Array(7)
			weekday[0] = "星期日"
			weekday[1] = "星期一"
			weekday[2] = "星期二"
			weekday[3] = "星期三"
			weekday[4] = "星期四"
			weekday[5] = "星期五"
			weekday[6] = "星期六"
			var w = weekday[now.getDay()];
			document.getElementById("time").innerHTML = "" + h + ":" + m + ":" + s;
			document.getElementById("week").innerHTML = "" + w + "";
			document.getElementById("show").innerHTML = "" + year + "-" + month + "-" + day + "";
			t = setTimeout("showTime()", 1000)
		}
	</script>
	<!-- 全屏 -->
	<script>
		function fullScreen() {
			var el = document.documentElement;
			var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen;
			if (typeof rfs != "undefined" && rfs) {
				rfs.call(el);
			};
			return;
		}
		//退出全屏
		function exitScreen() {
			if (document.exitFullscreen) {
				document.exitFullscreen();
			} else if (document.mozCancelFullScreen) {
				document.mozCancelFullScreen();
			} else if (document.webkitCancelFullScreen) {
				document.webkitCancelFullScreen();
			} else if (document.msExitFullscreen) {
				document.msExitFullscreen();
			}
			if (typeof cfs != "undefined" && cfs) {
				cfs.call(el);
			}
		}
	</script>
	<script>
		var swiper = ''
		/*
		* 图片轮播
		* */
		function loadScenePicture() {
			$.ajax({
				url: baseUrl + '/pcApi/biz/pcIndex/getScenePictureList',
				type: 'get',
				success: function (res) {
					if (res.code == '00000') {
						var rec = res.data;
						if (rec && rec.length > 0) {
							var pinHtml = '';
							for (let i = 0; i < rec.length; i++) {
								pinHtml += '<div class="swiper-slide">' +
									'<img src="' + rec[i].scenePictureImage + '" alt="">' +
									'</div>';
							}
							$('.swiper-wrapper').html(pinHtml);
							swiper = new Swiper('.swiper-container1', {
								pagination: {
									el: '.swiper-pagination',
									clickable: true,
								},
								autoplay: {
									delay: 3000,
									disableOnInteraction: false
								},
								speed: 900,
								loop: true,
							});
						}
					}
				}
			});
		}

		/*
		* 顶部数据
		* */
		function loadTopDeviceCount() {
			$.ajax({
				url: baseUrl + '/pcApi/biz/pcIndex/getTopDeviceCount',
				type: 'get',
				success: function (res) {
					if (res.code == '00000') {
						var rec = res.data;
						if (rec) {
							// 除尘器数量
							$('.catcher-count').text(rec.catcherCount);
							// 箱室数量
							$('.box-count').text(rec.boxCount);
							// 气包数量
							$('.pocket-count').text(rec.pocketCount);
							// 智能阀数量
							$('.zhi-valve-count').text(rec.intellectValveCount);
						}
						$('.counter').countUp({
							delay: 10,
							// time: 15000
							time: 1000
						});
					}
				}
			});
		}

		/*
		* 企业应用列表
		* */
		function loadCompanyList() {
			$.ajax({
				url: baseUrl + '/pcApi/biz/pcIndex/getCompanyList',
				type: 'get',
				success: function (res) {
					if (res.code == '00000') {
						var rec = res.data;
						if (rec && rec.length > 0) {
							var pinHtml = '';
							var recordItem = {}
							for (let i = 0; i < rec.length; i++) {
								pinHtml += '<li class="scroll_info" data-id="' + rec[i].companyId + '">' +
									'<ul class="scroll_nav">' +
									'<li>' + (i + 1) + '</li>' +
									'<li><span class="ellipses-one" onclick="goDataView(this)" data-id="' + rec[i].companyId + '" >' + rec[i].companyName + '</span></li>' +
									'<li>' + convertNull(rec[i].valveCount, 0) + '</li>' +
									'<li>' + convertNull(rec[i].controlCount, 0) + '</li>' +
									'<li>' + convertNull(rec[i].collectorCount, 0) + '</li>' +
									'</ul>' +
									'</li>';

								// 阀处理
								var operatingStatusName = '正常';
								if (rec[i].operatingStatus === '1') {
									operatingStatusName = '正常';
								} else if (rec[i].operatingStatus === '2') {
									operatingStatusName = '异常';
								} else if (rec[i].operatingStatus === '3') {
									operatingStatusName = '故障';
								}
								rec[i].operatingStatusName = operatingStatusName
								rec[i].totalDeviceCount = rec[i].totalDeviceCount ? rec[i].totalDeviceCount : 0
								rec[i].putIntoDate = rec[i].putIntoDate ? rec[i].putIntoDate : ''
								if (rec[i].longitude && rec[i].latitude) {
									recordItem = {
										name: rec[i].companyName,
										value: [rec[i].longitude, rec[i].latitude, rec[i].companyIndustry, rec[i].totalDeviceCount, rec[i].operatingStatusName, rec[i].putIntoDate, rec[i].companyId, rec[i].province]
									}
									if (rec[i].companyValveType === '0') {
										puValveArray.push(recordItem);
										// puValveArray[0].value[4] = '异常' // 模拟数据
									} else {
										zhiValveArray.push(recordItem);
										// zhiValveArray[0].value[4] = '故障' // 模拟数据
									}
									allValueArray = zhiValveArray.concat(puValveArray)
								}
							}
							$('.company-list').append(pinHtml);

							// 渲染完成后开启无缝滚动
							$('.scroll-company-wrap').liMarquee({
								direction: 'up',
								runshort: false,
								scrollamount: 15
							});
							// 初始化地图
							mapInit();
						}
					}
				}
			});
		}

		/*
		* 行业在线运行率
		* */
		function loadIndustryOperatingRate() {
			$.ajax({
				url: baseScreenUrl + '/prod-api/pcApi/biz/pcIndex/industryOperatingRate',
				type: 'get',
				success: function (res) {
					let rec = res.data;
					if (rec) {
						var lineColor = '';
						var progress = ''
						// 小于5个则隐藏其他圆
						if (rec.length <= 5) {
							// 隐藏其他圆  最多五个圆
							for (let i = rec.length + 1; i <= 5; i++) {
								$('.my_circle-class-' + i).hide();
							}
							for (let i = 0; i < rec.length; i++) {
								if (i === 0) {
									lineColor = '#0AA2F8';
								} else if (i === 1) {
									lineColor = '#F38128';
								} else if (i === 2) {
									lineColor = '#20E9B6';
								} else if (i === 3) {
									lineColor = '#E9B529';
								} else if (i === 4) {
									// 第五个和之后不处理
									lineColor = '#7131E3';
								}
								progress = new Progress({
									el: 'my_circle' + i, //canvas元素id
									deg: parseFloat(rec[i].industryScale) * 100, //绘制角度
									timer: 5, //绘制时间
									lineWidth: 10, //线宽
									lineBgColor: '#4f626b', //底圆颜色
									lineColor: lineColor, //动态圆颜色
									textColor: '#20E9B6', //文本颜色
									fontSize: 18, //字体大小
									circleRadius: 100 //圆半径
								});
								$(".fenxi" + i).html(rec[i].industryName)
							}
						} else {
							// 大于5个  或等于5个算其他中
							let lastIndex = 0;
							let totalOtherCircleScale = 0;
							for (let i = 4; i < rec.length; i++, lastIndex++) {
								totalOtherCircleScale += parseFloat(rec[i].industryScale);
							}
							for (let i = 0; i < 4; i++) {
								if (i === 0) {
									lineColor = '#0AA2F8';
								} else if (i === 1) {
									lineColor = '#F38128';
								} else if (i === 2) {
									lineColor = '#20E9B6';
								} else if (i === 3) {
									lineColor = '#E9B529';
								}
								progress = new Progress({
									el: 'my_circle' + i, //canvas元素id
									deg: parseFloat(rec[i].industryScale) * 100, //绘制角度
									timer: 5, //绘制时间
									lineWidth: 10, //线宽
									lineBgColor: '#4f626b', //底圆颜色
									lineColor: lineColor, //动态圆颜色
									textColor: '#20E9B6', //文本颜色
									fontSize: 18, //字体大小
									circleRadius: 100 //圆半径
								});
								$(".fenxi" + i).html(rec[i].industryName)
							}
							progress = new Progress({
								el: 'my_circle4', //canvas元素id
								deg: (totalOtherCircleScale / lastIndex) * 100, //绘制角度
								timer: 5, //绘制时间
								lineWidth: 10, //线宽
								lineBgColor: '#4f626b', //底圆颜色
								lineColor: '#7131E3', //动态圆颜色
								textColor: '#20E9B6', //文本颜色
								fontSize: 18, //字体大小
								circleRadius: 100 //圆半径
							});
							$(".fenxi4").html('其他')
						}
					}
				}
			});
		}

		/*
		* 检修提醒
		* */
		function loadExamineReminderPage() {
			$.ajax({
				url: baseUrl + '/pcApi/biz/pcIndex/getExamineReminderPage',
				type: 'get',
				data: {
					pageNum: 1,
					pageSize: 1000
				},
				success: function (res) {
					var rec = res.data;
					if (res.code == '00000') {
						var record = rec.list;
						if (record && record.length > 0) {
							var now = new Date();
							var year = now.getFullYear();
							var month = now.getMonth() + 1;
							var day = now.getDate();
							var currentDate = '' + year + '-' + month + '-' + day + '';

							var pinHtml = '';
							for (let i = 0; i < record.length; i++) {
								let addBuyDate = addYears(record[i].buyDate, parseInt(record[i].warrantyPeriod));
								let subBuyDate = dateMinus(currentDate, addBuyDate); // 日期时间差
								let scalaTime = humanise2(subBuyDate); // 计算差几个月  几年
								let scalaTime2 = humanise2(subBuyDate).split(' ');

								// console.log('----------', subBuyDate, humanise2(subBuyDate))
								let prefixImg1 = '';
								let prefixImg2 = '';
								let prefixImg3 = '';
								if (scalaTime2[0].indexOf('月') > -1) {
									let month = scalaTime2[0].replace('月', '');
									if (parseInt(month) <= 6) {
										prefixImg1 = 'dilcker1';
										prefixImg2 = 'dilcker2';
										prefixImg3 = 'dilcker3';
									}
								} else if (scalaTime2[0].indexOf('日') > -1) {
									prefixImg1 = 'dilcker1';
									prefixImg2 = 'dilcker2';
									prefixImg3 = 'dilcker3';
								}
								let showBuyTime = scalaTime2[0];

								pinHtml += '<li class="service_list">' +
									'<div class="service_name">' +
									'<img src="images/home_icon/icon_surplus_default@2x.png" alt="">' +
									'<p>距离保修年限</p>' +
									'<span>' + showBuyTime + '</span>' +
									'</div>' +
									'<div class="flicker">' +
									'<div class="flicker1 ' + prefixImg1 + '"></div>' +
									'<div class="flicker2 ' + prefixImg2 + '"></div>' +
									'<div class="flicker3 ' + prefixImg3 + '"></div>' +
									'</div>' +
									'<ul class="service_info">' +
									'<li>' +
									'<img src="images/home_icon/icon_business_default@2x.png" alt="">' +
									'<p>企业名称：' + record[i].companyName + '</p>' +
									'</li>' +
									'<li>' +
									'<img src="images/home_icon/icon_time_default@2x.png" alt="">' +
									'<p>购买日期：' + record[i].buyDate + '</p>' +
									'</li>' +
									'<li>' +
									'<img src="images/home_icon/icon_gua_default@2x.png" alt="">' +
									'<p>保修年限：' + record[i].warrantyPeriod + '年</p>' +
									'</li>' +
									'</ul>' +
									'</li>';
							}
						}
						$('.examine-reminder-page').append(pinHtml);
						// 渲染完成后开启无缝滚动
						$('.examine-reminder-page').liMarquee({
							direction: 'up',
							runshort: false,
							scrollamount: 15
						});
					}
				}
			});
		}

		function convertNull(value, deflautValue) {
			if (value || value === 0) {
				return value;
			} else {
				if (deflautValue) {
					return deflautValue;
				}

				if (deflautValue === 0) {
					return deflautValue;
				}
				return '';
			}
		}

		function goDataView(obj) {
			// console.log('obj')
			var id = $(obj).attr('data-id')
			window.location.href = pathUrl + '?id=' + id
		}

		//两个日期相差几个月
		function dateMinus(startTime, endTime) {
			//将xxxx-xx-xx的时间格式，转换为 xxxx/xx/xx的格式
			startTime = startTime.replace(/\-/g, "/");
			endTime = endTime.replace(/\-/g, "/");
			//将计算间隔类性字符转换为小写
			var sTime = new Date(startTime); //开始时间
			var eTime = new Date(endTime); //结束时间
			//作为除数的数字
			var timeType = 1000 * 3600 * 24;
			return parseInt((eTime.getTime() - sTime.getTime()) / parseInt(timeType));
		}

		function addYears(strTime, yearCount) {
			let splitTime = strTime.split('-');
			let c = parseInt(splitTime[0]) + yearCount;
			return c + '-' + splitTime[1] + '-' + splitTime[2];
		}

		function humanise(diff) {
			var str = '';
			var values = [
				[' year', 365],
				[' month', 30],
				[' day', 1]
			];

			for (var i = 0; i < values.length; i++) {
				var amount = Math.floor(diff / values[i][1]);

				if (amount >= 1) {
					str += amount + values[i][0] + (amount > 1 ? 's' : '') + ' ';

					// and subtract from the diff
					diff -= amount * values[i][1];
				}
			}
			return str;
		}

		function humanise2(diff) {
			var str = '';
			var values = [
				['年', 365],
				['月', 30],
				['日', 1]
			];

			for (var i = 0; i < values.length; i++) {
				var amount = Math.floor(diff / values[i][1]);

				if (amount >= 1) {
					str += amount + values[i][0] + (amount > 1 ? '' : '') + ' ';

					// and subtract from the diff
					diff -= amount * values[i][1];
				}
			}
			return str;
		}

		/*
		* 运维记录
		* */
		function loadMaintenancePage() {
			$.ajax({
				url: baseUrl + '/pcApi/biz/pcIndex/getMaintenancePage',
				type: 'get',
				data: {
					pageNum: 1,
					pageSize: 1000
				},
				success: function (res) {
					var rec = res.data;
					// console.log(rec)
					if (res.code == '00000') {
						var record = rec.list;
						if (record && record.length > 0) {
							var pinHtml = '';
							for (let i = 0; i < record.length; i++) {
								let infoBanner = '';
								let handleStatus = record[i].handleStatus;
								if (handleStatus === '1') {
									infoBanner = 'scroll_info1';
								}
								pinHtml += '<li class="scroll_info ' + infoBanner + '">' +
									'<ul class="scroll_nav">' +
									'<li>' + {
										0: '未处理',
										1: '已处理'
									}[record[i].handleStatus] + '</li>' +
									'<li>' + record[i].companyBriefName + '</li>' +
									'<li>' + record[i].monitoringSection + '</li>' +
									'<li>' + record[i].type + '</li>' +
									'<li>' + (record[i].handlerTime ? record[i].handlerTime : '') + '</li>' +
									'</ul>' +
									'</li>';
							}
						}
						$('.maintenance-page').append(pinHtml);
						// 渲染完成后开启无缝滚动
						$('.maintenance-page').liMarquee({
							direction: 'up',
							runshort: false,
							scrollamount: 15
						});
					}
				}
			});
		}

		/*
		* 专利技术
		* */
		function loadPatentData() {
			$.ajax({
				url: baseUrl + '/pcApi/biz/pcIndex/getPatentScale',
				type: 'get',
				success: function (res) {
					var rec = res.data;
					var patentTotal = 0;
					var patentArray = [];
					for (let i = 0; i < rec.length; i++) {
						patentTotal += parseInt(rec[i].patentCount);
						patentArray.push({
							value: rec[i].patentCount,
							name: rec[i].patentName
						});
					}
					patentChart(patentTotal, patentArray)
				}
			});
		}

		/*
		* 行业分布
		* */
		function loadIndustryData() {
			$.ajax({
				url: baseUrl + '/pcApi/biz/pcIndex/getIndustrialDistributionScale',
				type: 'get',
				success: function (res) {
					var rec = res.data;
					if (rec && rec.length) {
						var industrialDistributionArray = [];
						var xAxisArray = [];
						var totalCount = 0;
						var totalOtherCount = 0;
						var colorArray = [{
							color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
								offset: 0,
								color: '#0AA7FD'
							}, {
								offset: 1,
								color: '#16459E'
							}])
						}, {
							color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
								offset: 0,
								color: '#F7B723'
							}, {
								offset: 1,
								color: '#EF4A2D'
							}])
						}, {
							color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
								offset: 0,
								color: '#21F3C5'
							}, {
								offset: 1,
								color: '#1CD698'
							}])
						}, {
							color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
								offset: 0,
								color: '#E3BB19'
							}, {
								offset: 1,
								color: '#F2AC42'
							}])
						}];
						// 总数
						for (var i = 0; i < rec.length; i++) {
							totalCount += parseInt(rec[i].industrialCount);
						}

						for (var i = 0; i < rec.length; i++) {
							let currentScale = ((parseInt(rec[i].industrialCount) / totalCount) * 100).toFixed(2);
							let temp = {
								value: (currentScale * 100) / 100,
								count: rec[i].industrialCount,
							};
							let getColor = colorArray[i];
							if (getColor) {
								temp.itemStyle = getColor;
							}

							if (i >= 4) {
								totalOtherCount += parseInt(rec[i].industrialCount);
							} else {
								xAxisArray.push(rec[i].industrialName);
								industrialDistributionArray.push(temp);
							}
						}

						// 超过四个 包含4个算到其他中
						if (rec.length >= 4) {
							let currentOtherScale = ((totalOtherCount / totalCount) * 100).toFixed(2);
							xAxisArray.push('其他');
							industrialDistributionArray.push({
								value: (currentOtherScale * 100) / 100,
								count: totalOtherCount,
								itemStyle: {
									color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
										offset: 0,
										color: '#7335F6'
									},
									{
										offset: 1,
										color: '#6C228B'
									}
									])
								}
							})
						}
						industryChart(xAxisArray, industrialDistributionArray)
					}
				}
			});
		}

		/*
		* 设备监测
		* */
		function loadDeviceData() {
			$.ajax({
				url: baseUrl + '/pcApi/biz/pcIndex/getDeviceStatusCount',
				type: 'get',
				success: function (res) {
					var rec = res.data;
					let dataset = [];
					if (rec && rec.length > 0) {
						let totalDeviceCount = 0;
						for (let i = 0; i < rec.length; i++) {
							totalDeviceCount += parseInt(rec[i].statusCount);
						}

						let existNormalDeviceStatus = false;
						let existAbnormalDeviceStatus = false;
						let existAlaramDeviceStatus = false;
						for (let i = 0; i < rec.length; i++) {
							let cIndex = 2;
							let itemStyleClass = '#21F3C5';
							if (rec[i].statusName === '异常') {
								itemStyleClass = '#FE9F19';
								cIndex = 1;
								existAbnormalDeviceStatus = true;
							} else if (rec[i].statusName === '故障') {
								itemStyleClass = '#FE3649';
								cIndex = 0;
								existAlaramDeviceStatus = true;
							} else if (rec[i].statusName === '正常' || rec[i].statusName === '在线') {
								existNormalDeviceStatus = true;
							}

							let dScale = (parseInt(rec[i].statusCount) / totalDeviceCount).toFixed(2);
							dataset.push({
								value: dScale * 100,
								currentIndex: cIndex,
								statusName: rec[i].statusName,
								amount: rec[i].statusCount,
								itemStyle: {
									color: itemStyleClass
								}
							});
						}

						// 不存在正常设备数量
						if (!existNormalDeviceStatus) {
							dataset.push({
								value: 0,
								currentIndex: 2,
								amount: 0,
								statusName: '正常',
								itemStyle: {
									color: '#21F3C5'
								}
							});
						}
						// 不存在异常设备数量
						if (!existAbnormalDeviceStatus) {
							dataset.push({
								value: 0,
								currentIndex: 1,
								amount: 0,
								statusName: '异常',
								itemStyle: {
									color: '#FE9F19'
								}
							});
						}
						// 不存在故障设备数量
						if (!existAlaramDeviceStatus) {
							dataset.push({
								value: 0,
								currentIndex: 0,
								statusName: '故障',
								amount: 0,
								itemStyle: {
									color: '#FE3649'
								}
							});
						}

						dataset.sort(function (a, b) {
							if (a.currentIndex < b.currentIndex) {
								return -1;
							} else if (a.currentIndex > b.currentIndex) {
								return 1;
							}
							return 0;
						});
					}
					deviceChart(dataset)
				}
			});
		}

		$(function () {
			// 加载现场图片
			loadScenePicture();

			// 顶部设备数量
			loadTopDeviceCount();

			// 地图上企业 && 企业应用列表
			loadCompanyList();

			// 加载行业在线运行率
			loadIndustryOperatingRate();

			// 检修提醒
			loadExamineReminderPage();

			// 运维记录
			loadMaintenancePage();

			// 专利技术利用率
			loadPatentData();
			// 行业分布占比
			loadIndustryData();
			// 设备监测
			loadDeviceData();
		});
	</script>
</body>

</html>